package com.glsc.ngateway.common.base.domain.mysql.gateway.platform.flow.cmdb;

import com.glsc.ngateway.common.base.domain.mysql.gateway.FlowFormBaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author liwei
 * @date 2023/8/2-14:44
 * 新增的CPU规格明细数据
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@Entity
@Where(clause = "deleted = 0")
@SQLDelete(sql = "update t_gw_flow_form_device_memory_standard_new_detail set deleted = UNIX_TIMESTAMP(NOW()) where id=?")
@SQLDeleteAll(sql = "update t_gw_flow_form_device_memory_standard_new_detail set deleted = UNIX_TIMESTAMP(NOW()) where id=?")
@Table(name = "t_gw_flow_form_device_memory_standard_new_detail")
@org.hibernate.annotations.Table(appliesTo = "t_gw_flow_form_device_memory_standard_new_detail", comment = "新增的device-内存规格明细数据-配件规格变更流程子表")
public class FlowFormNewDeviceMemoryStandardDetail extends FlowFormBaseEntity {

    @Column(name = "modify_type", columnDefinition = "varchar(10) comment '业务类型:0-新增,1-删除'")
    private String modifyType;

    @Column(name = "memory_standard_name", length = 100, columnDefinition = "varchar(100) comment '内存规格名称'")
    private String memoryStandardName;

    @Column(name = "memory_amount", columnDefinition = "int comment '内存数量'")
    private Integer memoryAmount;

    @Column(name = "memory_device_relate_id", columnDefinition = "int comment 'CmdbMemoryStandardDeviceStandardRelate的id'")
    private Integer memoryDeviceRelateId;

    @Column(name = "device_standard_code", length = 100)
    private String deviceStandardCode; // 设备规格id

    @Column(name = "memory_standard_code", length = 100)
    private String memoryStandardCode; // memory规格id

}
